# -*- coding: utf-8 -*-
"""
@Time    : 2020/5/18 14:22
@Author  : Corey
"""
from PyQt5.QtCore import QThread, pyqtSignal
import csv


class WriteExcel(QThread):
    def __init__(self, label_list, data_list, path):
        super().__init__()
        self.label_list = label_list
        self.data_list = data_list  # data_list [[], []]
        self.filepath = path

    def run(self):
        with open(self.filepath, "w", newline="") as fw:
            csvObj = csv.writer(fw)
            csvObj.writerow(self.label_list)
            for row in self.data_list:
                csvObj.writerow(row)
